package com.kpmg.datalake.reportanalysis.service;

import com.alibaba.fastjson.JSONObject;
import com.kpmg.datalake.common.model.DataExportCondition;
import com.kpmg.datalake.common.vo.KeyAndValueDTO;
import com.kpmg.datalake.common.vo.ServerResponse;
import com.kpmg.datalake.db.model.RqsList;
import com.kpmg.datalake.db.model.SysUsr;
import java.io.IOException;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.multipart.MultipartFile;

/**
 * 数据相关操作服务
 *
 * @author Tony
 */
public interface DataService {

  /**
   * 依据项目ID获取查询请求列表
   */
  JSONObject getRequestList(String projectId, String searchValue, String orderColumn,
      String orderDir,
      int start, int size);

  /**
   * 通过主键查询信息
   *
   * @param rqsListId rqsListId
   * @return RqsList
   */
  RqsList selectRqsListById(String rqsListId);

  /**
   * 依据项目ID获取查询请求列表
   */
  ServerResponse getRequestList2(String projectId, String searchValue, String orderColumn,
      String orderDir, int start, int size);

  /**
   * 获取会计年月
   */
  JSONObject getAccYearMonth(String projectId);

  /**
   * 获取会计月份
   */
  List<String> getAccMonth(String projectId, String monthBegin, String monthEnd);

  /**
   * 导出所有账套信息
   */
  void exportAllBookSet(String projectId, SysUsr user, HttpServletRequest request,
      HttpServletResponse response);

  /**
   * 上传筛选账套
   */
  KeyAndValueDTO<Boolean, String> uploadBookSet(SysUsr user, MultipartFile bookSetFile);

  /**
   * 数据导出请求
   */
  String exportRequest(SysUsr user, DataExportCondition condition, String bookLocation,
      String projectId);

  /**
   * 记录用户下载
   */
  void logFileDownload(String userId, String requestNo);

  /**
   * 刷新请求任务状态
   */
  void flushRequestStatus(boolean reboot);

  void exportCheckReport(String projectId, String requestCode, HttpServletRequest request,
      HttpServletResponse response) throws IOException;

}
